//
//  WDTaskDetailSectionView.m
//  wd-serviceapp
//
//  Created by Bin Tang on 2024/8/29.
//

#import "WDTaskDetailSectionView.h"

@interface WDTaskDetailSectionView ()
@property (nonatomic, strong) UILabel *titleLabel;

@property (nonatomic, copy) NSString *title;

@end

@implementation WDTaskDetailSectionView

- (void)initWithSubView {
    [super initWithSubView];
    
    self.backgroundColor = [UIColor colorWithHexString:@"#F5F5F5"];
}


- (void)initWithTitleLabel {
    if (!_titleLabel) {
        CGRect frame = CGRectMake(20, (self.height - 30) * 0.5, self.width - 40, 30);
        _titleLabel = [UILabel createWithLabel:self frame:frame font:[UIFont systemFontOfSize:14 weight:UIFontWeightMedium] propertiesBlock:^(UILabel * _Nonnull label) {
            label.textColor = [UIColor colorWithHexString:@"#000000"];
        }];
    }
    if (self.title) {
        self.titleLabel.text = objectNull(self.title);
    }
}

- (void)updateWithViewData:(id)data {
    self.title = data;
    
    [self initWithTitleLabel];
}


@end
